<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>选择资源</title>
	<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="../css/pop-page.css" />
	<script type="text/javascript" src="../easyui/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="../js/win.js"></script>
	<script type="text/javascript">
		function selectRes(){
			var nodes = $("#resTree").tree('getChecked');
			if (nodes.length == 0){
				$.messager.alert("提示", "&nbsp;&nbsp;<br/>请选择一条记录!", "info");
			} else {
				var ids = "";
		        var arrId = [];
		        var nameArr = [];
		        for (var i = 0;i < nodes.length; i++){
		            arrId.push(nodes[i].id);
		        }
		        ids = arrId.join(",");
				parent.selectRoleRes(ids);
			}
		}
		
		function initResTree(){
			$('#resTree').tree({
				url:"../resource/findResTree.do",
				checkbox:true
			});
		}
		
		$(function(){
			initResTree();
		});
	</script>
</head>

<body class="easyui-layout">
	<div data-options="region:'center',border:false">
		<div class="dg-content">
			<ul id="resTree"></ul>
		</div>
	</div>
	<div data-options="region:'south'" class='fm-btn'>
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="selectRes()">确定</a>
	</div>
</body>
</html>